3.18 \(\int \cot (c+d x) (a+i a \tan (c+d x))^2 \, dx\)

Optimal. Leaf size=37 \[ \frac{a^2 \log (\sin (c+d x))}{d}+\frac{a^2 \log (\cos (c+d x))}{d}+2 i a^2 x \]

[Out]

(2*I)*a^2*x + (a^2*Log[Cos[c + d*x]])/d + (a^2*Log[Sin[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0390279, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091, Rules used = {3541, 3475} \[ \frac{a^2 \log (\sin (c+d x))}{d}+\frac{a^2 \log (\cos (c+d x))}{d}+2 i a^2 x \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + I*a*Tan[c + d*x])^2,x]

[Out]

(2*I)*a^2*x + (a^2*Log[Cos[c + d*x]])/d + (a^2*Log[Sin[c + d*x]])/d

Rule 3541

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d*(2
*b*c - a*d)*x)/b^2, x] + (Dist[d^2/b, Int[Tan[e + f*x], x], x] + Dist[(b*c - a*d)^2/b^2, Int[1/(a + b*Tan[e +
f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cot (c+d x) (a+i a \tan (c+d x))^2 \, dx &=2 i a^2 x+a^2 \int \cot (c+d x) \, dx-a^2 \int \tan (c+d x) \, dx\\ &=2 i a^2 x+\frac{a^2 \log (\cos (c+d x))}{d}+\frac{a^2 \log (\sin (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.0382218, size = 30, normalized size = 0.81 \[ \frac{a^2 (\log (\tan (c+d x))+2 \log (\cos (c+d x))+2 i d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + I*a*Tan[c + d*x])^2,x]

[Out]

(a^2*((2*I)*d*x + 2*Log[Cos[c + d*x]] + Log[Tan[c + d*x]]))/d

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 47, normalized size = 1.3 \begin{align*} 2\,i{a}^{2}x+{\frac{2\,i{a}^{2}c}{d}}+{\frac{{a}^{2}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{2}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+I*a*tan(d*x+c))^2,x)

[Out]

2*I*a^2*x+2*I/d*a^2*c+a^2*ln(cos(d*x+c))/d+a^2*ln(sin(d*x+c))/d

________________________________________________________________________________________

Maxima [A]  time = 2.01946, size = 57, normalized size = 1.54 \begin{align*} \frac{2 i \,{\left (d x + c\right )} a^{2} - a^{2} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + a^{2} \log \left (\tan \left (d x + c\right )\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

(2*I*(d*x + c)*a^2 - a^2*log(tan(d*x + c)^2 + 1) + a^2*log(tan(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]  time = 2.17877, size = 49, normalized size = 1.32 \begin{align*} \frac{a^{2} \log \left (e^{\left (4 i \, d x + 4 i \, c\right )} - 1\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

a^2*log(e^(4*I*d*x + 4*I*c) - 1)/d

________________________________________________________________________________________

Sympy [A]  time = 0.941224, size = 22, normalized size = 0.59 \begin{align*} \frac{a^{2} \log{\left (e^{4 i d x} - e^{- 4 i c} \right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))**2,x)

[Out]

a**2*log(exp(4*I*d*x) - exp(-4*I*c))/d

________________________________________________________________________________________

Giac [B]  time = 1.30354, size = 101, normalized size = 2.73 \begin{align*} -\frac{4 \, a^{2} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right ) - a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-(4*a^2*log(tan(1/2*d*x + 1/2*c) + I) - a^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a^2*log(abs(tan(1/2*d*x + 1/2
*c) - 1)) - a^2*log(abs(tan(1/2*d*x + 1/2*c))))/d